abstract class AbstractClass {
  templateMethod() {
    this.specialMethod()
    this.abstractMethod1()
    this.abstractMethod2()
  }
  private specialMethod() {
    console.log("抽象类中的具体方法被调用...");
  }

  protected abstract abstractMethod1(): void
  protected abstract abstractMethod2(): void
}


class ConcreteClass extends AbstractClass {
  protected abstractMethod1() {
    console.log("抽象方法1的实现被调用...");
  }
  protected abstractMethod2() {
    console.log("抽象方法2的实现被调用...");
  }
}

class ClientClass {
  tm: AbstractClass = new ConcreteClass()

  main() {
    this.tm.templateMethod()
  }
}

const client = new ClientClass()
client.main()